package com.gfv.facturas.controladores;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

public class LogoutControlador extends AbstractController{
	protected final Log logger = LogFactory.getLog(getClass());
	private String vista;

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse resp) throws Exception {
		logger.error("Entramos en Logout");
		HttpSession sesion = req.getSession(false);
		sesion.invalidate();
		return new ModelAndView(getVista());
	}
	public String getVista() {
		return vista;
	}
	public void setVista(String vista) {
		this.vista = vista;
	}
}
